package com.project.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.ProductBean;
import com.project.service.IProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

@RestController
@RequestMapping("product")
public class ProductController {

    @Autowired
    private IProductService productService;
    @RequestMapping("findByItem")
    public IPage<ProductBean> findByItem(int pageNo,
                                         String name,
                                         LocalDate startDate,LocalDate endDate){
        return productService.findByItem(pageNo, name, startDate, endDate);
    }
    @RequestMapping("findById")
    public ProductBean findById(int productId){
        return productService.findById(productId);
    }

}
